﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LibFriesland_Campina_CRM
{
    public class BizProduct
    {
        #region Thuoc tinh
        public string product_charid { get; set; }
        public string name { get; set; }
        public string variant { get; set; }
        public int size { get; set; }
        public decimal price { get; set; }
        public string caculation_unit { get; set; }
        public string by_product_catalouge { get; set; }
        #endregion

        #region Ham thiet lap
        public BizProduct() { }
        public BizProduct(string pProduct_charid, string pName, string pVariant, int pSize, decimal pPrice, string pCalculation_unit, string pBy_product_catalouge)
        {
            product_charid = pProduct_charid;
            name = pName;
            variant = pVariant;
            size = pSize;
            price = pPrice;
            caculation_unit = pCalculation_unit;
            by_product_catalouge = pBy_product_catalouge;
        }
        public BizProduct(string pProduct_charid, string pName, string pBy_product_catalouge)
        {
            product_charid = pProduct_charid;
            name = pName;
            by_product_catalouge = pBy_product_catalouge;
        }
        #endregion

        #region Phuong thuc
        //Lay thong tin product theo id
        public static BizProduct getProductbyID(string pProduct_charid)
        {
            return DalProduct.getProductbyID(pProduct_charid);
        }
        #endregion

        #region Dung cho Webservice
        //Lay danh sach Product: product_charid - name - by_product_catalouge
        public static List<BizProduct> getAll()
        {
            return DalProduct.getAll();
        }
        #endregion
    }
}
